//
//  GDFBaseTabBarController.m
//  GlobalDeliciousFood
//
//  Created by lanou on 16/1/11.
//  Copyright © 2016年 com.mjykj.www. All rights reserved.
//

#import "GDFBaseTabBarController.h"
#import "GDFRecommendsMainListVC.h"
#import "GDFCitysMainListVC.h"
#import "GDFMomentMainListVC.h"
#import "GDFFoodNotesMainListVC.h"
#import "GDFMyInfoMainListVC.h"

@interface GDFBaseTabBarController ()

@end

@implementation GDFBaseTabBarController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self addViewControllerClass:[GDFRecommendsMainListVC class] title:@"推荐" imageName:@"tuijian" selectImageName:nil];
    
    [self addViewControllerClass:[GDFCitysMainListVC class] title:@"城市" imageName:@"chengshi" selectImageName:nil];
    
    [self addViewControllerClass:[GDFMomentMainListVC class] title:@"片刻" imageName:@"iconfont-naozhong" selectImageName:nil];
    
    [self addViewControllerClass:[GDFFoodNotesMainListVC class] title:@"食记" imageName:@"shi'ji" selectImageName:nil];
    
    [self addViewControllerClass:[GDFMyInfoMainListVC class] title:@"我的" imageName:@"wode" selectImageName:nil];
    
    self.tabBar.barTintColor = [UIColor blackColor];
    self.tabBar.tintColor = [UIColor orangeColor];
    
    
    
}

- (void)addViewControllerClass:(Class)class title:(NSString *)title imageName:(NSString *)imageName selectImageName:(NSString *)selectImageName
{
    UIViewController *viewVC = [[class alloc]init];
    UINavigationController *naVC = [[UINavigationController alloc] initWithRootViewController:viewVC];
    naVC.tabBarItem.title = title;
    naVC.tabBarItem.image = [UIImage imageNamed:imageName];
    viewVC.navigationItem.title = title;
    [self addChildViewController:naVC];
    
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
